package com.fjnldx.ks.service;

import com.fjnldx.ks.pojo.domain.*;
import com.fjnldx.ks.mapper.MesSecondMapper;
import com.fjnldx.ks.pojo.request.GydReq;
import com.fjnldx.ks.pojo.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MesSecondService {
    @Autowired
    MesSecondMapper mesSecondMapper;

    /**
     * 获取组织
     */
    public Result getOrganization(){
        List<Organization> allOrg = mesSecondMapper.getAllOrg();
        return Result.success(allOrg);
    }
    /**
     * 获取车间
     */
    public Result getWorkShop(){
        List<CeJian> allCeJian = mesSecondMapper.getAllWorkShop();
        return Result.success(allCeJian);
    }
    /**
     * 获取工序
     */
    public Result getProcedure(){
        List<GongXu> allGongXu = mesSecondMapper.getAllGongXu();
        return Result.success(allGongXu);
    }
    /**
     * 获取设备类型
     */
    public Result getEquipment(){
        List<Equipment> allEquipment = mesSecondMapper.getAllEquipment();
        return Result.success(allEquipment);
    }
    /**
     * 获取品种名称
     */
    public Result getVarieties(){
        List<Pz> allVarieties = mesSecondMapper.getAllPz();
        return Result.success(allVarieties);
    }
    /**
     * 获取工艺单模板
     */
    public Result getProcessSheet(GydReq gydReq){
        List<ProcessSheet> processSheet1 = mesSecondMapper.getProcessSheet(gydReq);
        return Result.success(processSheet1);
    }
}
